

/** 关卡商品信息 */

import { LoadModule_blxf } from "../Module/LoadModule";

const {ccclass, property} = cc._decorator;

@ccclass
export default class VendorInfoItem_blxf extends cc.Component {

    @property({ type: cc.Sprite, tooltip: '商品图片' })
    shopImgSpr: cc.Sprite = null;

    @property({ type: cc.Node, tooltip: '遮罩节点' })
    maskNode: cc.Node = null;


    @property({ tooltip: '传入参数' })
    _options: any = null;

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {

    }

    // update (dt) {}

    initData ( options: any ) {
        this._options = options;

        this.updateUI();
    }

    updateUI () {
        let { imgPath, imgName, isPass } = this._options;

        this.maskNode.opacity = isPass ? 255 : 0;

        LoadModule_blxf.instance.LoadImg_blxf({
            path: imgPath, imgName, imgSpr: this.shopImgSpr
        })
    }

}
